//
//  CZSelectPhotoOrCrmera.m
//  globalTranslate
//
//  Created by 陈镇 on 2025/8/14.
//

#import "CZSelectPhotoOrCrmera.h"


@interface CZSelectPhotoOrCrmera ()


@end
@implementation CZSelectPhotoOrCrmera


-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
        [self addSubview:self.leftBtn];
        [self addSubview:self.rightBtn];
    }
    return self;
}

-(QMUIButton *)leftBtn{
    if (!_leftBtn) {
        
        _leftBtn = [QMUIButton createButtonTitle:@"相册" titleColor:UIColor.whiteColor font:SLFontMakeRegular(17)];
        _leftBtn.backgroundColor = UIColorHex(#0D6886);
        [_leftBtn sl_cornerRadius:8];
    }
    return _leftBtn;
}

-(QMUIButton *)rightBtn{
    if (!_rightBtn) {
        _rightBtn = [QMUIButton createButtonTitle:@"拍照" titleColor:UIColor.whiteColor font:SLFontMakeRegular(17)];
        _rightBtn.backgroundColor = UIColorHex(#0D6886);
        [_rightBtn sl_cornerRadius:8];
    }
    return _rightBtn;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    
    
    CGFloat left = 30;
    CGFloat gap = 30;
    CGFloat width = (self.width - left * 2 - gap)/2;
    _leftBtn.frame = CGRectMake(left, 0, width, self.height);
    _rightBtn.frame = CGRectMake(_leftBtn.right +gap, 0, width, self.height);
    
    
}

@end
